import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Test from '@/views/exploreAndTest/test'
import Test2 from '@/views/exploreAndTest/test2'
import login from '@/views/login'
import home from '@/layout/index'
import page404 from '@/views/404'
import page403 from '@/views/403'
import elasticsearchExplore from '@/views/exploreAndTest/elasticsearchExplore'
import mongoExplore from '@/views/exploreAndTest/mongoExplore'
import rabbitmqExplore from '@/views/exploreAndTest/rabbitmqExplore'
import socketExplore from '@/views/exploreAndTest/socketExplore'
import userManage from '@/views/systemManage/userManage/userManage'
import homePage from '@/views/homePage'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/test',
      name: 'Test',
      component: Test
    },
    {
      path: '/login',
      name: 'login',
      meta: {
        title: '星航启程'
      },
      component: login
    },
    {
      path: '/home',
      name: 'home',
      meta: {
        title: '星航畅游'
      },
      component: home,
      children: [
        {
          path: '/uploadDownloadExplore',
          name: 'uploadDownloadExplore',
          meta: {
            title: '上传测试'
          },
          component: Test2
        },
        {
          path: '/searchEngine',
          name: 'searchEngine',
          meta: {
            title: '搜索引擎测试'
          },
          component: elasticsearchExplore
        },
        {
          path: '/mongoExplore',
          name: 'mongoExplore',
          meta: {
            title: 'mongo测试'
          },
          component: mongoExplore
        },
        {
          path: '/rabbitmqExplore',
          name: 'rabbitmqExplore',
          meta: {
            title: 'rabbitmq测试'
          },
          component: rabbitmqExplore
        },
        {
          path: '/socketExplore',
          name: 'socketExplore',
          meta: {
            title: 'socket测试'
          },
          component: socketExplore
        },
        {
          path: '/userManage',
          name: 'userManage',
          meta: {
            title: '用户管理'
          },
          component: userManage
        },
        {
          path: '/homePage',
          name: 'homePage',
          meta: {
            title: ''
          },
          component: homePage
        }
      ]
    },
    {
      path: '/page404',
      name: 'page404',
      meta: {
        title: 'page 404'
      },
      component: page404
    },
    {
      path: '/page403',
      name: 'page403',
      meta: {
        title: 'page 403'
      },
      component: page403
    }
  ]
})
